<?php

function smarty_function_get_carproperty_by_serialize_id($params, &$smarty) {
    //Get value from page
    $carproperty_id = $params['id'];
    $pntables = pnDBGetTables();
    //var_dump($carproperty_id);
    if($carproperty_id){
      $carpropertyArray = array();
      foreach(unserialize($carproperty_id) as $value){
        //Query data
        $sql = "SELECT
                  pro_name  
                FROM ".
                $pntables[innoforum_carproperty].
               " WHERE
                  pro_id = ".$value;

        $column = array("name");
        $result = DBUtil::executeSQL($sql);
        $objectArray = DBUtil::marshallObjects ($result, $column);
        $carpropertyArray[] = $objectArray[0];
      }

      //var_dump($carpropertyArray);
    }
    if ($carpropertyArray) {
        $smarty->assign('carpropertyName', $carpropertyArray); 
    } else {
        return "";
    }
}